
<body class="layui-layout-body">

    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">
                <img src="<?= base_url() ?>public/img/logo.png" />
            </div>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="<?= base_url() ?><?= $userinfo['photo'] ?>" class="layui-nav-img"> <?= $userinfo['username'] ?>
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a href="<?= site_url('home/profile') ?>" target="right">设置</a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="<?= site_url('home/logout') ?>">退出</a>
                </li>
                <?php if($userinfo['level']>=50): ?>
                <li class="layui-nav-item">
                    <button class="layui-btn layui-btn-normal layui-btn-sm initdata">数据重置</button>
                </li>
                <?php endif; ?>
            </ul>
        </div>

        <div class="layui-side">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item">
                        <a href="<?= site_url('template/index') ?>" target="right"><i class="layui-icon">&#xe68e;</i>主页</a>
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;"><i class="layui-icon">&#xe630;</i>模板管理</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="<?= site_url('template/editing') ?>" target="right"><i class="layui-icon">&#xe65b;</i>邮件模板</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('template/listing') ?>" target="right"><i class="layui-icon">&#xe65b;</i>模板列表</a>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;"><i class="layui-icon">&#xe62f;</i>发件管理</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="<?= site_url('home/mailserver') ?>" target="right"><i class="layui-icon">&#xe65b;</i>域名发件人</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('address/index') ?>" target="right"><i class="layui-icon">&#xe65b;</i>代理发件人</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('address/senderlist') ?>" target="right"><i class="layui-icon">&#xe65b;</i>代理发件列表</a>
                            </dd>
                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;"><i class="layui-icon">&#xe601;</i>收件管理</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="<?= site_url('address/group') ?>" target="right"><i class="layui-icon">&#xe65b;</i>添加分组</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('address/addreceiver') ?>" target="right"><i class="layui-icon">&#xe65b;</i>添加收件人</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('address/receiverlist') ?>" target="right"><i class="layui-icon">&#xe65b;</i>收件人列表</a>
                            </dd>

                        </dl>
                    </li>
                    <li class="layui-nav-item">
                        <a class="" href="javascript:;"><i class="layui-icon">&#xe628;</i>任务管理</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="<?= site_url('task/index') ?>" target="right"><i class="layui-icon">&#xe65b;</i>添加任务</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('task/log') ?>" target="right"><i class="layui-icon">&#xe65b;</i>发件统计</a>
                            </dd>
                        </dl>
                    </li>
                    <!--个人用户没有权限查看此列表-->
                    <?php if ($userinfo['level'] > 0): ?>
                        <li class="layui-nav-item">
                            <a class="" href="javascript:;"><i class="layui-icon">&#xe612;</i>用户管理</a>
                            <dl class="layui-nav-child">
                                <dd>
                                    <a href="<?= site_url('member/index') ?>" target="right"><i class="layui-icon">&#xe65b;</i>我的团队</a>
                                </dd>
                                <?php if ($userinfo['level'] >= 50): ?>
                                    <dd>
                                        <a href="<?= site_url('member/verify') ?>" target="right"><i class="layui-icon">&#xe65b;</i>用户审核</a>
                                    </dd>
                                    <?php if ($userinfo['level'] >= 99): ?>
                                        <dd>
                                            <a href="<?= site_url('member/manage') ?>" target="right"><i class="layui-icon">&#xe65b;</i>用户管理</a>
                                        </dd>
                                    <?php endif; ?>
                                <?php endif; ?> 
                            </dl>
                        </li>
                    <?php endif; ?>
                    <li class="layui-nav-item">
                        <a href="javascript:;"><i class="layui-icon">&#xe620;</i>设置</a>
                        <dl class="layui-nav-child">
                            <dd>
                                <a href="<?= site_url('home/config') ?>" target="right"><i class="layui-icon">&#xe65b;</i>配置管理</a>
                            </dd>
                            <dd>
                                <a href="<?= site_url('home/profile') ?>" target="right"><i class="layui-icon">&#xe65b;</i>账户设置</a>
                            </dd>
                            
                        </dl>
                    </li>

                </ul>
            </div>
        </div>

        <div class="layui-body">
            <iframe scrolling="auto" rameborder="0"  name="right" width="100%" height="100%" src="<?= site_url('task/index') ?>">

            </iframe>
        </div>

        <div class="layui-footer">
            © Copyrigyt by emailsu
        </div>
    </div>
    <script>
        //JavaScript代码区域
        layui.use(['element','layer'], function () {
            var element = layui.element,layer = layui.layer;
            $(".initdata").click(function(){
                let url = "<?=site_url('home/handinit')?>";
                $.post(url,function(redata){
                    layer.msg(redata.error);
                },'json')
            })

        });
    </script>
</body>

</html>
